package com.example.bookstore.beans;

import javax.faces.bean.ManagedBean;

import com.example.bookstore.cart.ShoppingCart;
import com.example.bookstore.entity.Book;

@ManagedBean(name = "details")
public class DetailsBean extends BaseBean {

	public String add() {
		Book selected = selected();
		ShoppingCart cart = shoppingCart();

		cart.add(selected.getBookId(), selected);

		return "cart";
	}
}
